<!DOCTYPE html>
<html>
<head>
	<title>获取数据数组【JSON】</title>
	<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
</head>
<body>
	<input type="button" value="获取数据"/>
	<div id="info"></div>
	<script>
	$('input').click(function(){
		$.ajax({
			url:"{:U('dem2')}",
			type:'get',
			success:function(data){
				var res = eval(data);
				$('#info').html(res[0].title);
			}
		});
	});
	</script>
</body>
</html>